import { defineStore } from "pinia"
import { ref } from "vue"

export const useUserStore=defineStore('user',()=>{
  const token =ref('')
  //保存token
  const setToken=(value:string)=>{
    token.value=value
  }
  //清除token
  const clearToken=()=>{
    token.value=''
  }
  //保存用户id
  const userId=ref('1112')
  return {
    token,
    setToken,
    clearToken,
    userId
  }
},{
  unistorage:true
})